<?php
namespace view;

class LoginStatusView {


    /**
    * @param object \controller\ApplicationController $loginModel
    * @return string HTML
    *
    * här kollar vi om det ska visas ett meddelande för användaren om man tex knappat fel inloggningsuppgifter
    */
	public function returnLoginStatus(\model\LoginModel $loginModel) {

        if ($loginModel->sessionLoginModel->m_userHasBeenLogedIn == true) {
            $loginStatus = "<p>You have been loged out!</p>";

        } else if ($loginModel->m_usernameIsMissing === null) {
            $loginStatus = "";

        } else if ($loginModel->m_usernameIsMissing == true) {
			$loginStatus = "<p>Sign in with your username and password!</p>";

		} else if ($loginModel->m_passwordIsMissing == true) {
		        $loginStatus = "<p>Missed your password???</p>";

		} else if ($loginModel->m_hasValidUsername == false) {
			$loginStatus = "<p>Wrong login!</p>";

        } else if ($loginModel->m_hasValidPassword == false) {
            $loginStatus = "<p>Sorry, try again!!!</p>";

        } else {
			$loginStatus = "";
		}
        return $loginStatus;
	}


}

